//
//  PEMDailyExerciseCell.swift
//  RelationshipIntegration
//
//  Created by iOS-Czz on 2023/11/16.
//

import UIKit

class PEMDailyExerciseCell: UITableViewCell {
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    @IBOutlet var typeIcon: UIImageView!
    
    @IBOutlet var energyLabel: UILabel!
    @IBOutlet var stepLabel: UILabel!
    @IBOutlet var durationLabel: UILabel!
    @IBOutlet var typeNameLabel: UILabel!
    @IBOutlet var distanceLabel: UILabel!
    @IBOutlet var nameLabel: UILabel!
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    var model: PEMDailyExerciseModel? {
        didSet {
            self.typeIcon.image = UIImage(named: TYPE_ICONS[self.model!.type])
            self.distanceLabel.text = "Movement distance: \(model!.distance)km"
            self.nameLabel.text = self.model?.name
            self.typeNameLabel.text = TYPES_NAMES[self.model!.type]
            self.durationLabel.text = "\(model!.duration)h"
            self.stepLabel.text = "\(model!.step)"
            self.energyLabel.text = "\(model!.engery)"
        }
    }
}
